<template>
  <header class="app-header">
    <div class="header-container">
      <div class="logo">
        <router-link to="/" class="logo-link">
          <h1>二手交易平台</h1>
        </router-link>
      </div>
      
      <nav class="navigation">
        <router-link to="/" class="nav-link">首页</router-link>
        <router-link to="/publish" class="nav-link">发布商品</router-link>
        <router-link to="/cart" class="nav-link">购物车</router-link>
        <router-link to="/profile" class="nav-link">个人中心</router-link>
      </nav>
      
      <div class="user-actions">
        <router-link to="/login" class="login-btn">登录</router-link>
        <router-link to="/register" class="register-btn">注册</router-link>
      </div>
    </div>
  </header>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()
</script>

<style scoped>
.app-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo-link {
  text-decoration: none;
  color: white;
}

.logo h1 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
}

.navigation {
  display: flex;
  gap: 30px;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.router-link-active {
  background-color: rgba(255, 255, 255, 0.2);
}

.user-actions {
  display: flex;
  gap: 15px;
}

.login-btn,
.register-btn {
  padding: 8px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

.login-btn {
  color: white;
  border: 1px solid white;
}

.login-btn:hover {
  background-color: white;
  color: #667eea;
}

.register-btn {
  background-color: white;
  color: #667eea;
}

.register-btn:hover {
  background-color: #f8f9fa;
}
</style>